\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{assign}[2009/09/01 v0.1 Typesetting my assignments/essays at Macquarie University]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\ProcessOptions
\LoadClass[a4paper,12pt,svgnames,titlepage,twoside]{scrartcl}
\RequirePackage[top=2.5cm,bottom=2.5cm,right=2.5cm,left=2.5cm]{geometry}
\RequirePackage{graphicx,xcolor,amsmath,amssymb,amsthm,delarray,calc,tikz,fancybox,multicol,enumerate,ragged2e,tocbibind}
\RequirePackage{pifont}
\RequirePackage{bbding}
\RequirePackage{fourier}
\RequirePackage{times}
\RequirePackage{pstricks}
\RequirePackage{pstricks-add}
\RequirePackage{pst-3dplot}
\RequirePackage{pst-node}
\RequirePackage{pst-plot}
\RequirePackage[bottom,stable,ragged]{footmisc}
\RequirePackage[automark,nouppercase]{scrpage2}
\RequirePackage{tocstyle}
\RequirePackage{caption}
\captionsetup{
   margin = 10pt,
   font = {small,rm},
   labelfont = {small,bf},
   format = plain, % 
   indention = 0em,  % 
   labelsep = colon, %
   justification = RaggedRight, % 
   singlelinecheck = true, % 
   position = bottom %
}
\definecolor{myred}{rgb}{0.65,0.04,0.07}
\definecolor{lightgray}{gray}{0.95}
\definecolor{lightblue}{rgb}{0.61,.8,.8}
\definecolor{myblue}{rgb}{0.02,0.04,0.48}
\definecolor{Orange}{rgb}{1,.4,.2}
\definecolor{blendedred}{rgb}{0.9,0.1,0.1} 
\definecolor{blendedgreen}{rgb}{0.2,0.7,0.2}
\usetikzlibrary{shapes,snakes}
\renewcommand\labelitemi{\HandRight}
\renewcommand\labelitemii{\HandRightUp}
\renewcommand\labelitemiii{\HandCuffRight}
\renewcommand\labelitemiv{\HandPencilLeft}
\setlength\columnseprule{0.9pt}
\pagestyle{scrheadings} 
\clearscrheadings
\ohead{P. \pagemark}
\ihead{\headmark}
\rofoot{MATH235, Solution To Assignment 1}
\lofoot{Vafa Khalighi, SID:~41206312}
\lefoot{MATH235, Solution To Assignment 1}
\refoot{Vafa Khalighi, SID:~41206312}
\automark[subsection]{section}
\setheadsepline{.5pt}[\color{myred}]
\setfootsepline{.5pt}[\color{myred}]
\setheadwidth[0pt]{text}
\setfootwidth[0pt]{text}
\renewcommand{\footnoterule}{\vspace*{-3pt}{%
   \color{myred}\hrule width 2in height 0.4pt}
   \vspace*{2.6pt}}
\deffootnote{1.5em}{1em}{\makebox[1.5em][l]{%
   \thefootnotemark.}}
\addtolength{\skip\footins}{\baselineskip}
\settocfeature{pagenumberhook}{\normalfont\color{Orange}P.{ }}%
\renewenvironment{theindex}{%
  \if@twocolumn
    \@restonecolfalse
  \else
    \@restonecoltrue
  \fi
  \columnseprule \z@
  \columnsep 35\p@
  \idx@heading%
  \index@preamble\par\nobreak
  \thispagestyle{scrheadings}\parindent\z@
  \setlength{\parskip}{\z@ \@plus .3\p@}%
  \setlength{\parfillskip}{\z@ \@plus 1fil}%
  \let\item\@idxitem
}{%
  \if@restonecol\onecolumn\else\clearpage\fi
}
\addtokomafont{sectioning}{\color{myblue}} 
\renewcommand*{\raggedsection}{\raggedright}
\newtheorem{theorem}{Theorem}[section]
\numberwithin{figure}{section}
\numberwithin{equation}{section}
\tikzstyle{proofbox} = [draw=red, fill=blue!20, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
\tikzstyle{prooftitle} =[fill=red, text=white]
\tikzstyle{notebox} = [draw=blendedred, fill=lightblue, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
\tikzstyle{notetitle} =[fill=blendedred, text=white, circle]
\tikzstyle{thmbox} = [draw=blue, fill=green!20, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
\tikzstyle{thmtitle} =[fill=blue, text=white, ellipse]
\tikzstyle{acknowledgmentbox} = [draw=Orange, fill=blue!10, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
\tikzstyle{acknowledgmenttitle} =[fill=Orange, text=white, ellipse]
\providecommand\assignImage{}
\newcommand\unitname[1]{\def\@unitname{#1}}
\newcommand\sid[1]{\def\@sid{#1}}
\renewcommand\maketitle{%
\thispagestyle{empty}%
\begin{titlepage}
\begin{pspicture}(1.6in,0)(21,21.7)
  \rput(11.1,3){\assignImage}
  \psframe[fillstyle=solid,linecolor=gray,fillcolor=gray,linestyle=solid,opacity=0.5](0,-5.75)(22.2,10)
  \psframe[fillstyle=solid,linecolor=blendedgreen,fillcolor=blendedgreen,linestyle=solid](0,10)(22.2,10.5)
  \psframe[fillstyle=solid,linecolor=myred,fillcolor=myred,linestyle=solid](0,21.1)(22.2,21.2)
  \rput[lb](3,22){\Huge\sffamily\color{blendedred}\psscalebox{2}{\textbf{\@unitname}}}
  \rput[lb](3,14.1){\parbox{17cm}{\sffamily\RaggedRight\bfseries\huge\@title}}
  \rput[lb](3,12.6){\parbox{15cm}{\sffamily\Large\@subtitle}}
  \rput[lb](3,7.6){\parbox{15cm}{\sffamily\@date}}
  \rput[lb](3,-2.6){\parbox[b]{19cm}{\sffamily\RaggedRight 
    Student Name:\hfill\makebox[7cm][l]{Student ID:}\\
    {\bfseries\tabular[t]{@{}l@{}}\@author\endtabular}\hfill\makebox[7cm][l]{%
      \bfseries\tabular[t]{@{}l@{}}\@sid\endtabular}}}
\end{pspicture}%
\end{titlepage}
\setcounter{footnote}{0}%
\global\let\thanks\relax%
\global\let\maketitle\relax%
\global\let\@thanks\@empty%
\global\let\@author\@empty%
\global\let\@date\@empty%
\global\let\@title\@empty%
\global\let\@subtitle\@empty%
\global\let\title\relax%
\global\let\author\relax%
\global\let\date\relax%
\global\let\and\relax%
}
\newcommand\acknowledgmenttext[1]{\def\@acknowledgmenttext{#1}}
\newcommand\acknowledgment{%
\vfill\noindent
  \begin{tikzpicture}
     \draw (0,0)  node[circle,
                       shade,
                       ball color=myred,minimum size=2cm]{};
     \draw[snake      = expanding waves,%
           color      = myred,%
           line width = 3pt](1.2,0)--(4,0);
    \end{tikzpicture}\par\vspace{1 cm}
    \noindent
  \newlength{\@lx}\settowidth{\@lx}{\huge Acknowledgment}%
  \advance\@lx3em\quad
    \rotatebox{90}{\hspace*{1.5em}{\huge\bfseries\color{gray}Acknowledgment}}
  \textcolor{myred}{\rule{2pt}{\@lx}}\quad%
  \begin{minipage}[b]{.90\textwidth}
    {%
    \noindent\hfill
     \raggedleft\Large
     \textbf{\textcolor{myred}{Acknowledgment}}\par
    \medskip\par%
     }%
     \@acknowledgmenttext\par
    \par\medskip
  \end{minipage}
}
\endinput
